{# this file is included by layout.html #}
      <div class="sidebar">
        <div class="sidebarwrapper">
          {% if display_toc %}
            <h3>Table Of Contents</h3>
            {{ toc }}
          {% endif %}
          {%- if prev %}
            <h4>Previous topic</h4>
            <p class="topless"><a href="{{ prev.link|e }}" title="previous chapter">{{ prev.title }}</a></p>
          {%- endif %}
          {%- if next %}
            <h4>Next topic</h4>
            <p class="topless"><a href="{{ next.link|e }}" title="next chapter">{{ next.title }}</a></p>
          {%- endif %}
          {% if sourcename %}
            <h3>This Page</h3>
            <ul class="this-page-menu">
              {% if builder == 'web' %}
                <li><a href="#comments">Comments ({{ comments|length }} so far)</a></li>
                <li><a href="{{ pathto('@edit/' + sourcename)|e }}">Suggest Change</a></li>
                <li><a href="{{ pathto('@source/' + sourcename)|e }}">Show Source</a></li>
              {% elif builder == 'html' %}
                <li><a href="{{ pathto(sourcename, true)|e }}">Show Source</a></li>
              {% endif %}
              <li><a href="http://bugs.python.org/XXX?page={{ sourcename|e }}">Report Bug</a></li>
            </ul>
          {% endif %}
          {% if current_page_name == "index" %}
            <h3>Download</h3>
            <p>
              XXX: Add download links here.
            </p>
            <h3>Old docs</h3>
            <p>
              XXX: Add links to old docs/essays/etc. here.
            </p>
          {% endif %}
          {% if current_page_name != "search" %}
            <h3>{{ builder == 'web' and 'Keyword' or 'Quick' }} search</h3>
            <form class="search" action="{{ pathto('search.rst') }}" method="get">
              <input type="text" name="q" size="18"> <input type="submit" value="Go">
              <input type="hidden" name="check_keywords" value="yes">
              <input type="hidden" name="area" value="default">
            </form>
          {% endif %}
        </div>
      </div>
